package DecoratorPattern;

import FactoryPattern.BookFactory;
import FactoryPattern.NovelFactory;
import Model.Book;

import java.util.Date;

public class DecoratorPatternExample {
    public static void main(String[] args) {
        // 创建一本书，基本罚款为 $5.0
        BookFactory novelFactory = new NovelFactory();
        Book novel = novelFactory.createBook("To Kill a Mockingbird", "Harper Lee", "9780061120084", "Fiction", 281, 9.99, new Date(), 5.0);

        // 创建逾期罚款装饰器，添加额外的逾期罚款为 $2.0
        OverdueFineDecorator overdueBook = new OverdueFineDecorator(novel, 2.0);

        // 显示书籍信息，包括逾期罚款
        overdueBook.displayInfo();
    }
}
